package com.admin.controller;

import com.admin.service.EmailService;
import com.data.entity.Admin;
import com.data.entity.EmailEntity;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 邮件服务
 *
 * @author: wangghua
 * @version: 1.0
 * @date: 2020-11-16 15:42
 **/
@RestController
@RequestMapping("/email")
@Api(tags = "邮件服务")
public class EmailController {

    @Resource
    EmailService emailService;

    /**
     * 发送邮件
     * @param emailEntity
     */
    @PostMapping("/sendQuestion")
    public void verifyEmail(EmailEntity emailEntity) {
        emailService.sendSimpleMail(emailEntity.getSendTo(), emailEntity.getTitle(), emailEntity.getDetail());
    }

}
